package com.wangp.mywrite.inwork.classloader;

/***
 * @author wangpeng
 * @since 2022-02-23  11:36
 */
public class Main {
    public static void main(String[] args) throws ClassNotFoundException {
        System.out.println(ClassLoader.getSystemClassLoader());

        String className = "com.wangp.mywrite.inwork.classloader.HelloService";
        MyClassLoader classLoader1 = new MyClassLoader();
        Class<?> aClass = classLoader1.loadClass(className);

        MyClassLoader classLoader2 = new MyClassLoader();
        Class<?> bClass = classLoader2.loadClass(className);

        if (aClass != bClass) {
            System.out.println("different class");
        }
    }
}
